""" A Google command line interface.  Provides a Python library for
building programs off Google's SOAP API and a command line program, gcli. """

# This is the installation script for gcli (Google Command Line Interface).
# Run it with: 'python setup.py install' or 'python setup.py --help'.

import sys
from distutils.core import setup
from imp import find_module


# Check for the modules we depend on.
try:
    fpconst_module = find_module('fpconst')
    soap_module = find_module('SOAPpy')

    if not fpconst_module:
        print 'gcli requires fpconst.  See http://research.warnes.net/projects/RStatServer/fpconst/ if your distribution does not ship with the fpconst module.'
        sys.exit(1)

    if not soap_module:
        print 'gcli requires SOAPpy.  See http://pywebsvcs.sourceforge.net/ if your distribution does not ship with the SOAPpy module.'
        sys.exit(1)

except:
    print 'Checking for modules fpconst and SOAPpy failed.'
    print 'Make sure both modules are installed before trying setup.py again.'
    sys.exit(1)


from libgcli import __version__, __author__

script = 'gcli'
package = 'libgcli'

setup(name='gcli',
        version = __version__,
        author = __author__,
        author_email = 'deryck@samba.org',
        description = 'Google Command Line Interface',
        long_description = __doc__,
        url = 'http://www.devurandom.org/googledevel/gcli',
        license='GNU GPL v2 or later',
        packages=[package],
        data_files=[('/etc/gcli', ['wsdl/GoogleSearch.wsdl'])],
        scripts=[script])
        
